import FilterItem from "@/components/FilterItem.vue";
import SvgIcon from "@/components/SvgIcon.vue";
import DataTable from "@/components/DataTable.vue";
import ChartDataView from "@/components/ChartDataView.vue";
import TimeNodeTable from "@/components/TimeNodeTable.vue";
import CollapseBox from "@/components/CollapseBox.vue";
import CustomMenuBox from "@/components/CustomMenuBox.vue";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

// 创建全部全局组件对象
const allGloablComponents = {
  FilterItem,
  SvgIcon,
  DataTable,
  ChartDataView,
  TimeNodeTable,
  CollapseBox,
  CustomMenuBox,
};

// 全局插件，用于注册全局组件、指令、方法等
export default {
  install: (app) => {
    Object.keys(allGloablComponents).forEach((key) => {
      app.component(key, allGloablComponents[key]);
    });
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component);
    }
  },
};
